package com.lywz.biz.common.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author qianqi yangbolin
 * @date 2010-4-30
 */
public enum FoodTypeEnum {
    //qiancai对应黔菜,tangcai对应汤菜，huoguo对应火锅
    //mianshi对应面食,gaodian对应糕点，xiaochi对应特色小吃
    //meijiu对应美酒，tea对应香茶，techan对应特产食品
    qiancai(1,"黔菜"), tangcai(2,"汤菜"), huoguo(3,"火锅"),
    mianshi(4,"面食"), gaodian(5,"糕点"), xiaochi(6,"特色小吃"),
    meijiu(7,"美酒"), tea(8,"香茶"), techan(9,"特产食品");

    


    private Integer id;
    private  String name;

    private static Map<Integer, FoodTypeEnum> constantsMap;
    private static List<FoodTypeEnum> foodCollection;
    
    static{
        constantsMap = new HashMap<Integer, FoodTypeEnum>();
        foodCollection = new ArrayList<FoodTypeEnum>();
        for(FoodTypeEnum c : FoodTypeEnum.values()){
            foodCollection.add(c);
            constantsMap.put(c.id, c);
        }
    }

    public static FoodTypeEnum getFoodTypeEnumById(Integer id)
    {
        return constantsMap.get(id);
    }
    public static String getNameById(Integer id){
        return constantsMap.get(id).getName();
    }
    
    public static List<FoodTypeEnum> getList(){
        return foodCollection;
    }
    
    FoodTypeEnum(Integer value,String name) {
        this.id = value;
        this.name = name;
    }
    
    /**
     * @return the id
     */
    public Integer getId() {
        return id;
    }

    
    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    
    /**
     * @param id the id to set
     */
    public void setId(Integer id) {
        this.id = id;
    }

    
    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }
}
